package com.hzcx.app.simplechat.ui.friend.presenter;

import android.content.Context;

import com.hzcx.app.simplechat.api.BaseObserver;
import com.hzcx.app.simplechat.base.BasePresenter;
import com.hzcx.app.simplechat.model.GroupModel;
import com.hzcx.app.simplechat.ui.friend.bean.GroupListBean;
import com.hzcx.app.simplechat.ui.friend.bean.GroupBean;
import com.hzcx.app.simplechat.ui.friend.contract.GroupListContract;

public class GroupListPresenter extends BasePresenter<GroupListContract.View> implements GroupListContract.Presenter {

    @Override
    public void getGroupList(Context context) {
        GroupModel.getGroupList(context, new BaseObserver<GroupListBean>() {
            @Override
            protected void onSuccess(GroupListBean data) {
                mView.groupListResult(data);
            }

            @Override
            public void onFailure(Throwable e, String errorMsg) {
                super.onFailure(e, errorMsg);
                mView.onFail();
            }
        });
    }
}
